from pydantic import BaseModel, Field
from typing import List, Optional
from datetime import datetime


class FileResponse(BaseModel):
    """文件信息响应模型"""
    id: int
    filename: str
    url: str
    size: int
    mime_type: str
    uploader_id: Optional[int] = None
    created_at: datetime

    class Config:
        from_attributes = True


class FileListResponse(BaseModel):
    """文件列表响应模型"""
    total: int
    items: List[FileResponse] 